<template>
    <div v-loading="flag">
        <cassotable :colList="col" :tablelist="tableData" :opt="true"></cassotable>
    </div>
</template>


<script>
import cassotable from "../../common/casso_table.vue"
export default {
    data() {
        return {
            col:[
                { props: "id", label: "系统ID" },
				{ props: "bname", label: "用户名" },
                { props: "bphone", label: "手机号" },
                { props: "add_time", label: "添加时间" },
            ],
            tableData:[],
            flag:true
        }
    },
    methods:{
        get_black_list(){
            this.$ajax.get("/blackusr").then(res=>{
                console.log(res);
                res.data.forEach(item=>{
                    item.add_time = this.timeFomat(item.add_time)
                })
                this.tableData = res.data;
                this.flag = false;
            })
        },
        timeFomat(val) {
			if (val) {
				let d = new Date(val);
				let yy = d.getFullYear();
				let mm = (d.getMonth() + 1).toString().padStart(2, "0");
				let dd = d.getDate().toString().padStart(2, "0");
				let hh = d.getHours().toString().padStart(2, "0");
				let mms = d.getMinutes().toString().padStart(2, "0");
				let ss = d.getSeconds().toString().padStart(2, "0");
				return `${yy}-${mm}-${dd} ${hh}:${mms}:${ss}`;
			} else {
				return val;
			}
		},
    },
    components:{
        cassotable
    },
    mounted() {
        this.get_black_list();
    },
}
</script>


<style lang="scss" scoped>
    
</style>